import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    redirect: '/login'// url 重定向到 路径:/login
  },
  {
    /* 当我们点击去登录按钮的时候,发起一个请求url地址 */
    path: '/login',
    name: 'Login',
    /* 跳转到组件:views文件夹下面的login文件夹下面的Login.vue 组件里面 */
    component: () => import('../views/login/Login.vue')
  },
  {
    path: '/dashBook',
    name: 'DashBook',
    component: () => import('../views/DashBook'),
    redirect: '/system/welcome',
    children:[
      {
        path: '/system/welcome',
        name: 'Welcome',
        component: () => import('../views/system/Welcome'),
      },
      {
        path: '/system/menu-category',
        name: 'Category',
        component: () => import('../views/system/MenuCategory'),
      },
      {
        path: '/system/users',
        name: 'Users',
        component: () => import('../views/system/Users'),
      },
      // ----------------------学员信息管理开始------------------------------
      {
        path: '/student/manage',
        name: 'StuManage',
        component: () => import('../views/student/StuManage')
      }
      // -----------------------学员信息管理结束-----------------------------
      ,{
        path: '/student/class',
        name: 'ClassManage',
        component: () => import('../views/student/ClassManage')
      },
      {
        path: '/student/grade',
        name: 'GradeManage',
        component: ()=> import('../views/student/GradeManage')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
